package com.zkl.user.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zkl.user.model.UserContributeChangeRecord;
import com.zkl.user.mapper.UserContributeChangeRecordMapper;
import com.zkl.user.service.UserContributeChangeRecordService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.apache.commons.lang3.StringUtils;

import java.util.List;
/**
 * <p>
 * 用户贡献值变动记录表 服务实现类
 * </p>
 *
 * @author gongxz
 * @since 2020-01-16
 */
@Service
@Transactional
public class UserContributeChangeRecordServiceImpl extends ServiceImpl<UserContributeChangeRecordMapper, UserContributeChangeRecord> implements UserContributeChangeRecordService {

    @Autowired
    private UserContributeChangeRecordMapper userContributeChangeRecordMapper;

    @Override
    public IPage<UserContributeChangeRecord> selectPage(Page<UserContributeChangeRecord> page, UserContributeChangeRecord userContributeChangeRecord) {
        QueryWrapper<UserContributeChangeRecord> queryWrapper = new QueryWrapper<UserContributeChangeRecord>();
        getQueryWrapper(queryWrapper,userContributeChangeRecord);
        return userContributeChangeRecordMapper.selectPage(page,queryWrapper);
    }

    @Override
    public List<UserContributeChangeRecord> selectList(UserContributeChangeRecord userContributeChangeRecord) {
        QueryWrapper<UserContributeChangeRecord> queryWrapper = new QueryWrapper<UserContributeChangeRecord>();
        getQueryWrapper(queryWrapper,userContributeChangeRecord);
        return userContributeChangeRecordMapper.selectList(queryWrapper);
    }

    /**
     *  公共查询条件
     * @param queryWrapper
     * @return
     */
    public QueryWrapper<UserContributeChangeRecord> getQueryWrapper(QueryWrapper<UserContributeChangeRecord> queryWrapper,UserContributeChangeRecord userContributeChangeRecord){
        //条件拼接
    
        return queryWrapper;
    }
}
